﻿using System.Collections.Generic;
using System.Runtime.Serialization;
using LiSA_Server.Base.NHibernate.Models;
using NHibernate;
using NHibernate.Mapping.ByCode.Conformist;

namespace LiSA_Service.ResearchProjects.Models
{
    [DataContract]
    public class ProjectStage : Entity
    {
        [DataMember]
        public virtual string Description { get; set; }

        [DataMember]
        public virtual int Stage { get; set; }

        [DataMember]
        public virtual ICollection<string> DecisionPoints { get; set; } 
    }

    /// <summary>
    /// The ProjectStage mapping.
    /// </summary>
    public class ProjectStageMapping : ClassMapping<ProjectStage>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="ProjectStageMapping"/> class.
        /// </summary>
        public ProjectStageMapping()
        {
            this.Property(x => x.Description, x => x.Type(NHibernateUtil.StringClob));
            this.Property(x => x.Stage);
            this.Set(x => x.DecisionPoints, m => { }, r => r.Element());
        }
    }
}